﻿<UserControl x:Class="InteractivityQuickstart.Views.CustomPopupView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             Width="400">
    
    <Grid>
        <StackPanel>
            <TextBlock FontSize="24" Foreground="DarkRed" Margin="10">CustomPopupView</TextBlock>
            <TextBlock Margin="10" TextWrapping="Wrap">This is a custom view that is being shown in response to an interaction request being raised.</TextBlock>
            <TextBlock Margin="10" TextWrapping="Wrap">The data passed through the notification is:</TextBlock>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition />
                    <RowDefinition />
                </Grid.RowDefinitions>
                
                <TextBlock Margin="10,3" FontWeight="Bold" TextWrapping="Wrap" Grid.Row="0" Grid.Column="0">Title:</TextBlock>
                <TextBlock Margin="10,3" TextWrapping="Wrap" Grid.Row="0" Grid.Column="1" Text="{Binding Title}" /> 
                
                <TextBlock Margin="10,3" FontWeight="Bold" TextWrapping="Wrap" Grid.Row="1" Grid.Column="0">Content:</TextBlock>
                <TextBlock Margin="10,3" TextWrapping="Wrap" Grid.Row="1" Grid.Column="1" Text="{Binding Content}" />
            </Grid>
            <TextBlock Margin="10" TextWrapping="Wrap">
                The notification passed as a parameter in the InteractionRequest is automatically set as the DataContext of the window.
                As this view does not have its own DataContext it will inherit the DataContext of the hosting window.
            </TextBlock>
            <TextBlock Margin="10" TextWrapping="Wrap">
                You can either stop this iteration by closing the window or clicking the button below.
                The button will invoke the FinishInteraction action to close the window.
            </TextBlock>
            
            <Button AutomationProperties.AutomationId="CustomPopupCloseButton" Margin="10" HorizontalAlignment="Right" Width="75" Click="Button_Click">Close</Button>
        </StackPanel>
        
    </Grid>
</UserControl>
